package com.testing.class18;

import com.testing.inter.InterKeyword;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

/**
 * @Classname AuthAPI
 * @Description  类似于WEB中PO模式，将一个接口看成一个对象来进行设计。
 * Interkeyword类似于一个 BaseAPI
 * @Date 2022/7/7 20:06
 * @Created by 特斯汀Roy
 */
public class AuthAPI extends InterKeyword {

    private String url="http://www.testingedu.com.cn:8081/inter/HTTP/auth";

    @Test
    public void testAuth(){
        postUrl(url,"");
        Assert.assertTrue(jsonValueCheck("$.msg","success"));
    }


    @Test
    public void testAuthWithParam(){
        postUrl(url,"asdbfasdf");
        Assert.assertTrue(jsonValueCheck("$.msg","success"));
    }

    @Test
    public void testWithTokne(){
        addHeader("{\"token\":\"30fab78e87cb46c6b034c8f7925f2524\"}");
        postUrl(url,"asdasdfqw");
        Assert.assertTrue(jsonValueCheck("$.status","201"));
    }




}
